import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: () => import('@/views/layout/index.vue'),
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'Index',
          component: () => import('@/views/index/index.vue')
        },
        {
          path: '/clazz',
          name: 'Clazz',
          component: () => import('@/views/clazz/index.vue')
        },
        {
          path: '/dept',
          name: 'Dept',
          component: () => import('@/views/dept/index.vue')
        },
        {
          path: '/emp',
          name: 'Emp',
          component: () => import('@/views/emp/index.vue')
        },
        {
          path: '/log',
          name: 'Log',
          component: () => import('@/views/log/index.vue')
        },
        {
          path: '/stu',
          name: 'Stu',
          component: () => import('@/views/stu/index.vue')
        },
        {
          path: '/empReport',
          name: 'EmpReport',
          component: () => import('@/views/report/emp/index.vue')
        },
        {
          path: '/stuReport',
          name: 'StuReport',
          component: () => import('@/views/report/stu/index.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('@/views/login/index.vue')
    }
  ]
});

export default router;
